<%@page import="com.liferay.portal.kernel.xml.Document"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
<%@ page import="com.liferay.portal.theme.ThemeDisplay"%>
<portlet:defineObjects />
<portlet:renderURL var="readXML">
<portlet:param name="jspPage" value="/WEB-INF/layers-list.xml"/>
</portlet:renderURL>
<html>
<head></head>
<script type="text/javascript">
function drawSelectedItem()
{
	
	var _bounds;
	var inutTag = document.getElementsByName("itemChk");
	
	if(ID_LAYER_OLD != 0)
	resetColorFeatures(ID_LAYER_OLD,LAYER_LENGTH_OLD);
	resetColorFeatures(ID_LAYER,LAYER_LENGTH);
	
	for(var i=0; i < ARR_PAGING.length; i++)
	{
		if(inutTag[i].checked==true)
		{	
			
			for(var j=0; j < LAYER_LENGTH;j++)
				{
				if(map.layers[ID_LAYER].features[j].fid == ARR_PAGING[i].attribute["fid"])
					{
						map.layers[ID_LAYER].drawFeature(map.layers[ID_LAYER].features[j],"select");
						if(_bounds == null)
							_bounds = map.layers[ID_LAYER].features[j].geometry.getBounds().clone();
						_bounds.extend(map.layers[ID_LAYER].features[j].geometry.getBounds());
						break;
					}
				}
		}
	}
	if(_bounds != null)
	map.zoomToExtent(_bounds,false);
	
	LAYER_LENGTH_OLD = LAYER_LENGTH;
	ID_LAYER_OLD = ID_LAYER;
	dialog.close();
}

function ShowLayer()
{  
    ShowPopupContent(SELECTED_LAYER_NAME);	   	
    showComboField();
   
}
// Add list of attributes to popup
	ShowLayer();

</script>
<body>
 <table id="tblList" border="1" BORDERCOLOR="#C0C0C0">
 	
</table> 
<br>
<table>
<tr>
	<td>
		<INPUT id="btn" onclick="drawSelectedItem()" type="button" value='Select'/></td>
	<td>
		<INPUT id="btnExp" onclick="exportToExcel()" type="button" value='Export'/></td>
	<td width="100px"> </td>
	<td width="100px">
		<label id="IdlabTotal"></label></td>
	<td>
		<input type="button" id="btnBck" value="Previous" onClick="backPage()"></td>
	<td>
		<input type="button" id="btnNxt" value="Next" onClick="nextPage()"></td>
</tr>
</table>
	    </body>
	    <%
			String sRequest = renderRequest.getContextPath();
		%>
		<input id="txtRequest" type="hidden" value=<%=sRequest%>></input>
	    
	    <%
	    	String sScript_Path_Map = sRequest;
	    	sScript_Path_Map = sScript_Path_Map + "/js/object.js";
	    	out.println("<script type='text/javascript' src='" + sScript_Path_Map +"'></script>");
	    	
	    %>
	    <%
	    	String sScript_Path_Map1 = sRequest;
	    	sScript_Path_Map1 = sScript_Path_Map1 + "/js/popup.js";
	    	out.println("<script type='text/javascript' src='" + sScript_Path_Map1 +"'></script>");
	    	
	    %>
</html>
